<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .dialog {
      position: relative;
      width: 100%;
      height: 200px;
      background-color: pink;
      border-top-left-radius: 30px;
      border-top-right-radius: 30px;
      text-align: center;
      line-height: 200px;
      position: fixed;
      bottom: 0;
      transform: translate(0, 100%);
      transition: all 1s linear;
    }

    .dialog .inner {
      position: absolute;
      top: 10px;
      right: 10px;
      background-color: blue;
      width: 20px;
      height: 20px;
      line-height: 20px;
    }
  </style>
</head>

<body>
  <button class="btn">点击显示弹窗</button>
  <div class="dialog">弹窗
    <div class="inner">x</div>
  </div>
  <script>
    let btn = document.querySelector('.btn')
    let dialog = document.querySelector('.dialog')
    let inner = document.querySelector('.inner')
    btn.addEventListener('click', function () {
      dialog.style.transform = 'translateY(0)'
    })
    inner.addEventListener('click', function () {
      dialog.style.transform = 'translate(0, 100%)'
    })
  </script>
</body>

</html>